<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <style></style>
  </head>
  <body>
    <div>
      <h1>Webpack开启HMR</h1>
      <p>HMR已经集成在webpack-dev-server中</p>
      <p>可以通过webpack-dev-server --hot 开启</p>
      <p>也可以通过配置文件开启</p>
      <p>1.在webpack.config.js中的devServer属性中---devServer:{hot:true}</p>
      <p>2.导入webpack模块--const webpack = require('webpack')</p>
      <p>
        导入模块后再插件plugin属性中使用插件--new
        webpack.HotModuleReplacementPlugin()
      </p>
    </div>
    <script></script>
  </body>
</html>
